Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cherry-pick 96db1e0, fd08636 and bc9cb11 from chromium. #27437

Merged

Conversation

ppontes
Copy link
Member

@ppontes ppontes commented Jan 21, 2021

Add restrictions to allowed extensions for File System Access API

These restrictions apply to showOpenFilePicker and showSaveFilePicker.

Existing restriction:

  • Extension must start with "."

New restrictions:

  • Allowed code points: [A-Za-z0-9+.]
  • Extension length cannot exceed to 16, inclusive of leading "."
  • Extension cannot end with "."
  • Extension cannot end with "local" or "lnk"

(cherry picked from commit c75c5a1e1d72fc923c82ebcaeacc874c88215eff)

Bug: 1137247, 1140403, 1140410, 1140417, 1140435, 1152327
Change-Id: I593f7ca60e05177402885bd3026add16b3a07d0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2568534
Reviewed-by: Marijn Kruisselbrink mek@chromium.org
Commit-Queue: Austin Sullivan asully@chromium.org
Cr-Original-Commit-Position: refs/heads/master@{#833695}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2576109
Commit-Queue: Marijn Kruisselbrink mek@chromium.org
Auto-Submit: Austin Sullivan asully@chromium.org
Cr-Commit-Position: refs/branch-heads/4324@{#649}
Cr-Branched-From: c73b5a651d37a6c4d0b8e3262cc4015a5579c6c8-refs/heads/master@{#827102}

Ensure that showSaveFilePicker always shows the extension on Mac.

While not a very strong security boundary, making it possible for
users to know what extension a file will be saved with is a good idea.

This also fixes support for compound extensions with the File System
Access API (i.e. ".tar.gz"). The mac file dialog already had a
workaround if the default path ended in such an extension, but the
same problem occurs if the file type filters include a type with a
compound extension.

(cherry picked from commit 5bf1c6c22201394711a9067d2c970ab9f55555d0)

Bug: 1137247
Change-Id: I492bf36baced3de044b8fed5d57fc7b9b5b64400
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2582842
Reviewed-by: Daniel Cheng dcheng@chromium.org
Reviewed-by: Avi Drissman avi@chromium.org
Commit-Queue: Marijn Kruisselbrink mek@chromium.org
Cr-Original-Commit-Position: refs/heads/master@{#835803}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2597785
Reviewed-by: Marijn Kruisselbrink mek@chromium.org
Cr-Commit-Position: refs/branch-heads/4324@{#1044}
Cr-Branched-From: c73b5a651d37a6c4d0b8e3262cc4015a5579c6c8-refs/heads/master@{#827102}

[FSA] Sanitize descriptions for file types.

This collapses white space, limits the length of descriptions to 64
characters, and on windows strips out '*' characters to ensure the
windows dialog itself will still include the true extension.

This last behavior is triggered by the keep_extension_visible flag
that was added in https://crrev.com/c/2582842 to fix a similar problem
on Mac.

(cherry picked from commit 25f38bb6322c0d93722c1faa3f6b4ea2daf2dc90)

Tested: Verified that the extension is shown in the pickers shown by https://fsa-tests.glitch.me/accepts.html
Bug: 1137247
Change-Id: Ife2344589427dbc1055234026601642113b6a791
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2586958
Commit-Queue: Marijn Kruisselbrink mek@chromium.org
Reviewed-by: Robert Liao robliao@chromium.org
Reviewed-by: Victor Costan pwnall@chromium.org
Cr-Original-Commit-Position: refs/heads/master@{#837391}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2597151
Reviewed-by: Marijn Kruisselbrink mek@chromium.org
Cr-Commit-Position: refs/branch-heads/4324@{#1052}
Cr-Branched-From: c73b5a651d37a6c4d0b8e3262cc4015a5579c6c8-refs/heads/master@{#827102}

Release Notes

Notes: backported the fixes to the save file dialog related CVE-2021-21123, CVE-2021-21129, CVE-2021-21130, CVE-2021-21131, CVE-2021-21141.

@ppontes ppontes added semver/patch backwards-compatible bug fixes backport-check-skip Skip trop's backport validity checking 11-x-y labels Jan 21, 2021
@ppontes ppontes requested a review from a team as a code owner January 21, 2021 17:16
@codebytere codebytere merged commit 3bda527 into 11-x-y Jan 21, 2021
@release-clerk
Copy link

release-clerk bot commented Jan 21, 2021

Release Notes Persisted

backported the fixes to the save file dialog related CVE-2021-21123, CVE-2021-21129, CVE-2021-21130, CVE-2021-21131, CVE-2021-21141.

@codebytere codebytere deleted the cherry-pick/11-x-y/chromium/96db1e0-fd08636-bc9cb11 branch January 21, 2021 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11-x-y backport-check-skip Skip trop's backport validity checking semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants